# Maintainer: Breno Leitao <breno.leitao@gmail.com>
pkgname=py3-packaging
_pkgname=packaging
pkgver=20.4
pkgrel=0
pkgdesc="Core utilities for Python3 packages"
options="!check" # Requires py3-pytest which requires py3-setuptools
url="https://pypi.python.org/pypi/packaging"
arch="noarch"
license="Apache-2.0 AND BSD-2-Clause"
depends="python3 py3-parsing py3-six"
checkdepends="py3-pytest"
source="https://files.pythonhosted.org/packages/source/p/packaging/packaging-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-packaging" # Backwards compatibility
provides="py-packaging=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

check() {
	PYTHONPATH="$PWD/build/lib" python3 -m pytest \
		--ignore=tests/test_markers.py \
		--ignore=tests/test_specifiers.py \
		--ignore=tests/test_tags.py \
		--ignore=tests/test_version.py
	# tests that require https://pypi.org/project/pretend/ are disabled
	# above because py3-pretend hasn't been packaged for Alpine Linux
}

sha512sums="d53912041a9950efb5d221fc968adc328c2ef1e54ec9806d2158fd6db1b170e37afb05213f5750b10c59927504083ca3781c958caa0c802b1c7c0fe1ac1682a4  packaging-20.4.tar.gz"
